﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.ServiceProcess;
using System.Text;

namespace RDPBlock
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        static void Main(string[] args)
        {
            Console.WriteLine("Starting");
            if (args.Length > 0 && args[0] == "-debug")
            {
                
                RdpBlock rb = new RdpBlock();

                bool isWhiteList = rb.IsWhiteListed(System.Net.IPAddress.Parse("212.85.70.246"));
                isWhiteList = rb.IsWhiteListed(System.Net.IPAddress.Parse("87.56.213.77"));

                rb.DebugStart();
                while (Console.Read() != 'q')
                {

                }
                rb.DebugStop();
                

            }
            else
            {
                ServiceBase[] ServicesToRun;
                ServicesToRun = new ServiceBase[] 
			{ 
				new RdpBlock() 
			};
                ServiceBase.Run(ServicesToRun);
            }
        }
    }
}
